#!/bin/sh
# 
# run jserialio
# this should run on both Linux, Macintosh OSX Systems and Solaris. 
# 2006, lorenzo orselli
#-------------------------------------------------------------------------------

#following commands set path location of this script so that it can be drag and dropped into a terminal window.
#instead of having to cd into the jserialio folder and then run the command

CURRENT=$(dirname $0)
eval cd ${CURRENT} 
unset CURRENT

#following commands set java.library.path according OS

OS=`uname -s`
# echo $OS

if [ "${OS}" == "Linux" ] ; then
   JLIBRARY='Linux/i686-unknown-linux-gnu'   
elif [ "${OS}" == "Darwin" ] ; then
   JLIBRARY='Mac_OS_X'
elif [ "${OS}" == "SunOS" ] ; then
   JLIBRARY='Solaris/sparc-solaris/sparc32-sun-solaris2.8'  
else
   echo 'set manually JLIBRARY according your OS'
fi
unset OS
# echo $JLIBRARY

# java startup command

java -Djava.library.path=./lib/${JLIBRARY} -jar SerialIO.jar -classpath .:./lib

